package mulMan.domain;

import java.util.Observable;
import java.util.Observer;

public class AudioFileFactory implements Observer{
	
	private Library library;
	private AudioFile audioFile;
	
	public AudioFileFactory(Library library) {
		this.library = library;
	}
	
	public AudioFile newAudioFile() {
		audioFile = new AudioFile();
		audioFile.addObserver(this);
		return audioFile;
	}

	public void update(Observable o, Object arg) {
		
		if (arg == "id") {
			library.addElement(audioFile);
			audioFile.deleteObserver(this);
		}
	}
}
